home *** CD-ROM | disk | FTP | other *** search
Text File | 1989-12-07 | 1.9 KB | 91 lines | [TEXT/KAHL] |
- /*
- General functions for manipulating Dialogs
- Copyright © 1989 Farallon Computing, Inc
- */
-
- void SetRadioButton( DialogPtr, short);
- void ToggleRadioButtons( DialogPtr, short, short);
- void OutlineDefaultButton( DialogPtr);
- void HiliteDialogItem( DialogPtr, short);
- void UnHiliteDialogItem( DialogPtr, short);
-
- /*
- ** Outline dialog's default button as per
- ** Inside Mac Vol.I page 413
- */
- void OutlineDefaultButton( theDialog)
- DialogPtr theDialog;
- {
- GrafPtr savePort;
- Rect box;
- short itemType;
- Handle item;
-
- GetPort( &savePort);
- SetPort( theDialog);
-
- GetDItem( theDialog, 1, &itemType, &item, &box);
- PenSize(3,3);
- InsetRect( &box, -4, -4);
- FrameRoundRect( &box, 16, 16);
-
- SetPort( savePort);
- }
-
- /* place a bullet in the indicated radio button */
- void SetRadioButton( theDialog, theItem)
- DialogPtr theDialog;
- short theItem;
- {
- ControlHandle control;
- short itemType;
- Rect box;
-
- GetDItem( theDialog, theItem, &itemType, &control, &box);
- SetCtlValue( control, 1);
- }
-
- /*
- ** take bullet out of oldItem
- ** stick bullet in newItem
- */
- void ToggleRadioButtons( theDialog, oldItem, newItem)
- DialogPtr theDialog;
- short oldItem;
- short newItem;
- {
- ControlHandle control;
- short itemType;
- Rect box;
-
- GetDItem( theDialog, oldItem, &itemType, &control, &box);
- SetCtlValue( control, 0);
- GetDItem( theDialog, newItem, &itemType, &control, &box);
- SetCtlValue( control, 1);
- }
-
- void HiliteDialogItem( theDialog, itemNo)
- DialogPtr theDialog;
- short itemNo;
- {
- ControlHandle control;
- short itemType;
- Rect box;
-
- GetDItem( theDialog, itemNo, &itemType, &control, &box);
- HiliteControl( control, 0); /* Hilite Item */
- }
-
- void UnHiliteDialogItem( theDialog, itemNo)
- DialogPtr theDialog;
- short itemNo;
- {
- ControlHandle control;
- short itemType;
- Rect box;
-
- GetDItem( theDialog, itemNo, &itemType, &control, &box);
- HiliteControl( control, 255); /* UnHilite Item */
- }
-
-